﻿using System;
using System.Text.RegularExpressions;

namespace UntanglerApp
{
    public static class Utils
    {

        public static string EvaluateEnvironmentVariables(string value)
        {
            return _environmentVariableRegex.Replace(value,
                match => Environment.GetEnvironmentVariable(match.Groups[1].Value) ?? string.Empty);
        }

        static readonly Regex _environmentVariableRegex = new Regex(@"\$\((.+)\)");
    }
}
